package com.entertainment.ticketing.repository;

import com.entertainment.ticketing.entity.OrderInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Optional;

public interface OrderInfoRepository extends JpaRepository<OrderInfo, Long>, JpaSpecificationExecutor<OrderInfo> {
    Optional<OrderInfo> findByOrderNo(String orderNo);
    boolean existsByOrderNo(String orderNo);
    java.util.List<OrderInfo> findByUser_UsernameOrderByCreatedAtDesc(String username);
    Optional<OrderInfo> findByRemark(String remark);
    java.util.List<OrderInfo> findByStatusAndCreatedAtBefore(Byte status, java.time.LocalDateTime createdAt);
}